# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=nginx-ultimate-bad-bot-blocker
pkgver=4.2020.05.2060
pkgrel=0
pkgdesc="Nginx Bad Bot and User-Agent Blocker"
url="https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker"
arch="noarch"
license="MIT"
options="!check"
subpackages="$pkgname-doc"
source="nginx-ubbb-$pkgver.tar.gz::https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/archive/V$pkgver.tar.gz"

build() {
	return 0
}

package() {
	mkdir -p "$pkgdir"/etc/nginx
	mkdir -p "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/google
	mkdir -p "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/fail2ban
	mkdir -p "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/examples
	mkdir -p "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/generator-lists
	cp -rf conf.d "$pkgdir"/etc/nginx
	cp -rf bots.d "$pkgdir"/etc/nginx
	cp -rf man "$pkgdir"/usr/share
	cp -rf _fail2ban_addon "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/fail2ban
	cp -rf _sample_config_files "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/examples
	install -Dm700 update-ngxblocker "$pkgdir"/usr/sbin/update-ngxblocker
	install -Dm700 install-ngxblocker "$pkgdir"/usr/sbin/install-ngxblocker
	install -Dm700 setup-ngxblocker "$pkgdir"/sbin/setup-ngxblocker
	install -m644 _google_analytics_ghost_spam/* "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/google/
	install -m644 _google_webmaster_disavow_links/*.txt "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/google/
	install -m644 _generator_lists/* "$pkgdir"/usr/share/nginx-ultimate-bad-bot-blocker/generator-lists/
	install -Dm644 LICENSE.md "$pkgdir"/usr/share/licenses/nginx-ultimate-bad-bot-blocker/LICENSE
}

sha512sums="d3caef9c1022879be846b35eaf1356a887fe3ddfd8334fc87a23d5a34b4c090ba9ea69d0fda83ddc2407b0936f87434e75fa59fa48d0ad514eb86653f3d0aaf6  nginx-ubbb-4.2020.05.2060.tar.gz"
